home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / tcplusx.zip / GEN.H < prev    next >
C/C++ Source or Header  |  1991-03-02  |  3KB  |  113 lines

  1. #ifndef _GEN_H
  2. #define _GEN_H
  3.  
  4. //
  5. // gen.h        - header file for general purpose structures and classes
  6. // Author        - Robin W. McKean
  7. // Last Update    - February 17,1991
  8. // Copyright (C) 1991 All rights reserved
  9. // 
  10. // This file remains the property of the author, Robin W. McKean.  You are
  11. // free to use and change it as you see fit.  This module, nor its object
  12. // code, may not however be included  in any packaged software without the
  13. // written consent of the author.
  14. //
  15.  
  16. // Contents ----------------------------------------------------------------
  17. //
  18. //    Point
  19. //
  20. // Description
  21. //
  22. //        Defines a structure containing row/column coordinates
  23. //
  24. //    Sector
  25. //
  26. //    Description
  27. //
  28. //        Defines a sector of an object, defined as a square of some type
  29. //
  30. // End ---------------------------------------------------------------------
  31.  
  32. struct    Point
  33. {
  34.     int row;
  35.     int column;
  36. };
  37.  
  38. struct Sector
  39. {
  40.     int topRow;
  41.     int topColumn;
  42.     int bottomRow;
  43.     int bottomCol;
  44. };
  45.  
  46. struct Pen
  47. {
  48.     char            fillCharacter;        // Character based fill text
  49.     unsigned int    monoAttribute;        // Monochrome attribute
  50.     unsigned int    colorAttribute;     // Color attribute
  51.  
  52.     int             fillPattern;        // Graphics fill pattern
  53.     unsigned int    bwColor;            // CGA graphics colors
  54.     unsigned int    enhancedColor;        // EGA & VGA graphics colors
  55.     unsigned int    greyColor;            // Black and White VGA-EGA colors
  56. };
  57.  
  58. // Event types
  59. #define             NO_EVENT        0
  60. #define             E_KEY            1
  61. #define             E_MOUSE         2
  62. #define             ALT_KEY_PRESSED 3
  63.  
  64. // Device states
  65. #define             D_ON            0
  66. #define             D_OFF            1
  67. #define             D_INACTIVE        2
  68. #define                D_SHOW            3
  69. #define                D_POSITION        4
  70. #define                D_HIDE            5
  71. #define                D_INIT            6
  72. #define                DC_OVERTYPE        7
  73. #define                DC_INSERT        8
  74.  
  75. // Device types
  76. #define             D_KEYBOARD        0
  77. #define             D_MOUSE         1
  78. #define             D_CURSOR        2
  79.  
  80. // Non keyboard or mouse event type
  81. #define             S_DEVICE        10
  82.  
  83. // These are possible keyboard shift states
  84. #define K_SHIFT     0x3
  85. #define K_CTRL        0x4
  86. #define K_ALT        0x8
  87. #define K_SCROLL    0x10
  88. #define K_NUMLOCK    0x20
  89. #define K_CAPSLOCK    0x40
  90. #define K_INSERTON    0x80
  91.  
  92. #define    M_LEFT_SELECT        0x0010
  93. #define M_MIDDLE_SELECT        0x0011
  94. #define    M_RIGHT_SELECT        0x0012
  95. #define M_LCONTINUE_SELECT    0x0013
  96. #define M_RCONTINUE_SELECT    0x0014
  97. #define M_MCONTINUE_SELECT    0x0015
  98. #define M_MIDDLE_RELEASE    0x0016
  99. #define    M_LEFT_RELEASE        0x0017
  100. #define M_RIGHT_RELEASE        0x0018
  101.  
  102. #ifndef MAX
  103. #define MAX( a, b ) ( ( ( a ) >= ( b ) ) ? ( a ) : ( b ) )
  104. #define MIN( a, b ) ( ( ( a ) <= ( b ) ) ? ( a ) : ( b ) )
  105. #endif
  106.  
  107. #ifndef TRUE
  108. #define TRUE    1
  109. #define FALSE    0
  110. #endif
  111.  
  112. #endif
  113.